<template>
	<view class="f26r col313131">
		<navbar background="background-image: linear-gradient(to right, #2c6739, #99c043);"
			title="推广大使" back @onBack="goBack"
		></navbar>
		<view class="backImgLiGrTR2c6739a99c043 pl20r pr20r pb40r colFff">
			<view class="disFlex aliItCenter pt40r pb40r ">
				<view class="w100r">
					<image 
						:src="userInfo.avatar_url ? (imgNetUrl + userInfo.avatar_url) : (baseUrl + 'iconHeadPortrait.png')"
						class="w80r h80r bor1SFff borRad50P" mode="aspectFit"
						@click="cliBannerImg"
					></image>
				</view>
				<view class="flex1 webLiCl1 webBoxOrVer overHid disWebBox">
					<text class="foWeiBold f30r">
						{{userInfo.nickname}}
					</text>
				</view>
				<view class="w170r">
					<view class="lh60r borRad30r w150r teAliCenter backColCfb78b floRight"
						@click="goUrl('/pages/invitationRelevant/cashWithdrawal')"
					>
						去提现
					</view>
				</view>
			</view>
			<view class="disFlex teAliCenter">
				<view class="flex1">
					<view class="lh50r borR1SFaa77d f30r">
						0.00
					</view>
					<view class="f24r mt40r">
						可提现佣金（元）
					</view>
				</view>
				<view class="flex1">
					<view class="lh50r borR1SFaa77d f30r">
						0
					</view>
					<view class="f24r mt40r">
						已提现佣金（元）
					</view>
				</view>
			</view>
		</view>
		<view class="disFlex pt30r pb30r teAliCenter backColWhite mb20r">
			<view class="flex1" @click="goUrl('/pages/invitationRelevant/profitList')">
				<image :src="baseUrl + 'iconWalletBlack.png'" mode="aspectFit"
					class="w70r h70r"
				></image>
				<view class="mt10r">
					收益明细
				</view>
			</view>
			<view class="flex1" @click="goUrl('/pages/invitationRelevant/myPartner')">
				<image :src="baseUrl + 'iconPartner.png'" mode="aspectFit"
					class="w70r h70r"
				></image>
				<view class="mt10r">
					我的邀请
				</view>
			</view>
			<view class="flex1" @click="goUrl('/pages/invitationRelevant/invitationCode')">
				<image :src="baseUrl + 'iconPromotionCodeBlack.png'" mode="aspectFit"
					class="w70r h70r"
				></image>
				<view class="mt10r">
					推广码
				</view>
			</view>
		</view>
		<view class="backColWhite pl30r pr30r">
			<!-- <view class="lh90r" @click="goUrl('/pages/invitationRelevant/promotionOrder')">
				<text>
					推广订单
				</text>
				<image :src="baseUrl + 'iconRightBlack.png'" mode="aspectFit"
					class="w30r h30r floRight mt30r"
				></image>
			</view> -->
			<view class="lh90r" @click="goUrl('/pages/invitationRelevant/promotionRules')">
				<text>
					推广规则
				</text>
				<image :src="baseUrl + 'iconRightBlack.png'" mode="aspectFit"
					class="w30r h30r floRight mt30r"
				></image>
			</view>
			<!-- <button open-type="share" class="lh90r notBtnSty p0 backColWhite teAliLeft f26r">
				<text>
					分享好友
				</text>
				<image :src="baseUrl + 'iconRightBlack.png'" mode="aspectFit"
					class="w30r h30r floRight mt30r"
				></image>
			</button> -->
		</view>
	</view>
</template>
<script>
import navbar from '@/components/navbar.vue'
import { baseUrl, imgNetUrl } from '@/utils/request.js'
export default {
	components: { navbar },
	data() {
		return {
			baseUrl, imgNetUrl,
			userInfo: {},
			
		}
	},
	onLoad() {
		this.userInfo = uni.getStorageSync('userInfo');
		console.log(this.userInfo)
	},
	onShareAppMessage(res) {
	    if (res.from === 'button') {
	        console.log(33, res.target)
	    }
	    return {
	        title: '邀您一起喝茶，快来参与吧！',
			imageUrl: '/static/images/logo.png',
	        path: '/pages/index/index',
	        mpId: 'wxf8003ea15566ecd1'
	    }
	},
	methods: {
		goBack() {
			uni.navigateBack()
		},
		cliBannerImg() {
			let urls = (this.userInfo.avatar_url ? [imgNetUrl + this.userInfo.avatar_url] : [baseUrl + 'iconHeadPortrait.png']);
			uni.previewImage({
				current: 0, urls
			})
		},
		goUrl(url) {
			uni.navigateTo({
				url
			})
		},
		
	}
}
</script>